import { defineStore } from "pinia";
import axios from "axios";

export const listStore = defineStore("list", {
  state: () => ({
    lists: [],
  }),
  actions: {
    /* async getData() {
      let d = await axios.get("http://106.75.241.100:3012/home/page/1/10");
      this.lists = d.data.data;
    }, */

    getData() {
      return new Promise((resolve, reject) => {
        axios.get("http://106.75.241.100:3012/home/page/1/10").then((res) => resolve(res));
      }).catch((err) => reject(err));
    },
  },
});
